package com.wx.chapter10.static_;

/**
 * ClassName:Child
 * Package :com.wx.chapter10.static_
 * Description :
 *
 * @Author : coder_mu
 * @Create : 2023/6/2 - 14:17
 */
public class Child {
    private String name;
    //定义一个类变量(静态变量)static静态
    //该变量最大的特点就是会被Child类的所有对象实例共享
    public static int count = 0;

    //方法
    public void join() {
        System.out.println(name + "加入游戏");
    }

    //有参构造器
    public Child(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
